package com.solutec.tag10;

public class Thema3_ArrayMehrDimention {

	public static void main(String[] args) {

		int[][] arr = new int[2][5]; 
		
		for (int[] is : arr) {
			System.out.println(is.length);
		}
		
		System.out.println("----------------------");
		
		arr[0] = new int[] { 1, 1 };
		
		for (int[] is : arr) {
			System.out.println(is.length);
		}
		
		
		
		System.out.println("----------------------");
		
		int[] arrSimple = { 1, 2, 3 };
		
		int[] arr2D [] = { arrSimple , { 3, 3, 3, 3, 3, 3}  , { -1, -2 } };

		System.out.println(arr2D.length);
		//Alle Unterarrays durchlaufen
		for( int i=0; i<arr2D.length; i++) {
			
//			int[] tmpArr = arr2D[i];
//			for(int k=0;k<tmpArr.length;k++){
//				System.out.println(tmpArr[k] + " "); 	----> Alternative <---
//			}
			
			//Alle Elemente eines Unterarray durchlaufen
			for(int k=0 ; k<arr2D[i].length;  k++) {
				System.out.print( arr2D[i][k] + " " );
			}
			System.out.println();
		}
	}

}
